﻿using UnityEditor;
using UnityEngine.UI;

namespace CGF
{
    [CustomEditor(typeof(Switch))]
    public class SwitchEditor : Editor
    {
        Switch @switch;

        void OnEnable()
        {
            @switch = (Switch)target;
            if (!@switch.text) @switch.text = @switch.GetComponentInChildren<Text>();
        }
    }
}